using System;
using System.Collections.Generic;
using System.Text;
using Shc.Sql;
using Shc.Json;
namespace CLZ.Data
{
	public static class TableMyAddress
	{
		public const string Table = "MyAddress";
		public const string AddressID = "AddressID";
		public const string UserID = "UserID";
		public const string RegionID = "RegionID";
		public const string AreaID = "AreaID";
		public const string ProvinceName = "ProvinceName";
		public const string CityName = "CityName";
		public const string RegionName = "RegionName";
		public const string Consignee = "Consignee";
		public const string Zipcode = "Zipcode";
		public const string Address = "Address";
		public const string Telephone = "Telephone";
		public const string Mobile = "Mobile";
		public const string IsDefault = "IsDefault";
	}
	
	[Serializable]
	public class BaseMyAddress
		: IDbSessionEntity, IJsonClass
	{
		int m_AddressID;
		/// <summary>
        /// 
        /// </summary>
        public int AddressID
        {
            get { return m_AddressID; }
            set { m_AddressID = value; }
        }
		
		int m_UserID;
		/// <summary>
        /// 
        /// </summary>
        public int UserID
        {
            get { return m_UserID; }
            set { m_UserID = value; }
        }
		
		int? m_RegionID;
		/// <summary>
        /// 
        /// </summary>
        public int? RegionID
        {
            get { return m_RegionID; }
            set { m_RegionID = value; }
        }
		
		int? m_AreaID;
		/// <summary>
        /// 
        /// </summary>
        public int? AreaID
        {
            get { return m_AreaID; }
            set { m_AreaID = value; }
        }
		
		string m_ProvinceName;
		/// <summary>
        /// 
        /// </summary>
        public string ProvinceName
        {
            get { return m_ProvinceName; }
            set { m_ProvinceName = value; }
        }
		
		string m_CityName;
		/// <summary>
        /// 
        /// </summary>
        public string CityName
        {
            get { return m_CityName; }
            set { m_CityName = value; }
        }
		
		string m_RegionName;
		/// <summary>
        /// 
        /// </summary>
        public string RegionName
        {
            get { return m_RegionName; }
            set { m_RegionName = value; }
        }
		
		string m_Consignee;
		/// <summary>
        /// 
        /// </summary>
        public string Consignee
        {
            get { return m_Consignee; }
            set { m_Consignee = value; }
        }
		
		string m_Zipcode;
		/// <summary>
        /// 
        /// </summary>
        public string Zipcode
        {
            get { return m_Zipcode; }
            set { m_Zipcode = value; }
        }
		
		string m_Address;
		/// <summary>
        /// 
        /// </summary>
        public string Address
        {
            get { return m_Address; }
            set { m_Address = value; }
        }
		
		string m_Telephone;
		/// <summary>
        /// 
        /// </summary>
        public string Telephone
        {
            get { return m_Telephone; }
            set { m_Telephone = value; }
        }
		
		string m_Mobile;
		/// <summary>
        /// 
        /// </summary>
        public string Mobile
        {
            get { return m_Mobile; }
            set { m_Mobile = value; }
        }
		
		int m_IsDefault;
		/// <summary>
        /// 
        /// </summary>
        public int IsDefault
        {
            get { return m_IsDefault; }
            set { m_IsDefault = value; }
        }
		
		
		#region IDbSessionEntity Members
		public void ReadDBData(RowDataReader reader)
        {
            m_AddressID = reader[TableMyAddress.AddressID];
            m_UserID = reader[TableMyAddress.UserID];
            m_RegionID = reader[TableMyAddress.RegionID];
            m_AreaID = reader[TableMyAddress.AreaID];
            m_ProvinceName = reader[TableMyAddress.ProvinceName];
            m_CityName = reader[TableMyAddress.CityName];
            m_RegionName = reader[TableMyAddress.RegionName];
            m_Consignee = reader[TableMyAddress.Consignee];
            m_Zipcode = reader[TableMyAddress.Zipcode];
            m_Address = reader[TableMyAddress.Address];
            m_Telephone = reader[TableMyAddress.Telephone];
            m_Mobile = reader[TableMyAddress.Mobile];
            m_IsDefault = reader[TableMyAddress.IsDefault];
        }
		
		public void WriteDBData(RowDataWriter writer)
        {
            writer.SetPrimaryKey(TableMyAddress.AddressID, PrimaryKeyType.Identity, AddressID);
			writer[TableMyAddress.UserID] = UserID;
			writer[TableMyAddress.RegionID] = RegionID;
			writer[TableMyAddress.AreaID] = AreaID;
			writer[TableMyAddress.ProvinceName] = ProvinceName;
			writer[TableMyAddress.CityName] = CityName;
			writer[TableMyAddress.RegionName] = RegionName;
			writer[TableMyAddress.Consignee] = Consignee;
			writer[TableMyAddress.Zipcode] = Zipcode;
			writer[TableMyAddress.Address] = Address;
			writer[TableMyAddress.Telephone] = Telephone;
			writer[TableMyAddress.Mobile] = Mobile;
			writer[TableMyAddress.IsDefault] = IsDefault;
        }

        public void SetIdentityAfterInsert(DBObject idd)
        {
            m_AddressID = idd;
        }
		
		public string TableName
        {
            get { return TableMyAddress.Table; }
        }
		#endregion
		
		#region IJsonClass Members

        public void JsonDeSerializeObj(JsonHashTable hashToRead)
        {
             m_AddressID = hashToRead["AddressID"];
			 
             m_UserID = hashToRead["UserID"];
			 
             m_RegionID = hashToRead["RegionID"];
			 
             m_AreaID = hashToRead["AreaID"];
			 
             m_ProvinceName = hashToRead["ProvinceName"];
			 
             m_CityName = hashToRead["CityName"];
			 
             m_RegionName = hashToRead["RegionName"];
			 
             m_Consignee = hashToRead["Consignee"];
			 
             m_Zipcode = hashToRead["Zipcode"];
			 
             m_Address = hashToRead["Address"];
			 
             m_Telephone = hashToRead["Telephone"];
			 
             m_Mobile = hashToRead["Mobile"];
			 
             m_IsDefault = hashToRead["IsDefault"];
			 
        }

        public void JsonSerializeObj(JsonHashTable hashToFill)
        {
            hashToFill["AddressID"] = AddressID;
			 
            hashToFill["UserID"] = UserID;
			 
            hashToFill["RegionID"] = RegionID;
			 
            hashToFill["AreaID"] = AreaID;
			 
            hashToFill["ProvinceName"] = ProvinceName;
			 
            hashToFill["CityName"] = CityName;
			 
            hashToFill["RegionName"] = RegionName;
			 
            hashToFill["Consignee"] = Consignee;
			 
            hashToFill["Zipcode"] = Zipcode;
			 
            hashToFill["Address"] = Address;
			 
            hashToFill["Telephone"] = Telephone;
			 
            hashToFill["Mobile"] = Mobile;
			 
            hashToFill["IsDefault"] = IsDefault;
			 
        }

        #endregion
		
	}
}
